package com.yzqp.generator.util;

import com.yzqp.generator.util.generator.java.*;
import com.yzqp.generator.util.generator.vue.GeneratorApi;
import com.yzqp.generator.util.generator.vue.GeneratorEdit;
import com.yzqp.generator.util.generator.vue.GeneratorList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 生成全部的文件
 */
@Component
public class GeneratorAllUtil {

    // java

    @Autowired
    private GeneratorJavaBean JavaBean;
    @Autowired
    private GeneratorJavaController javaController;
    @Autowired
    private GeneratorJavaMapper javaMapper;
    @Autowired
    private GeneratorJavaMapperXml javaMapperXml;
    @Autowired
    private GeneratorJavaPageForm javaPageForm;
    @Autowired
    private GeneratorJavaSaveForm javaSaveForm;
    @Autowired
    private GeneratorJavaService javaService;
    @Autowired
    private GeneratorJavaVo javaVo;


    // vue
    @Autowired
    private GeneratorApi vueApi;
    @Autowired
    private GeneratorEdit vueEdit;
    @Autowired
    private GeneratorList vueList;



    // 生成全部文件
    public void generatorAllFile(){
        JavaBean.generatorFile();
        javaController.generatorFile();
        javaMapper.generatorFile();
        javaMapperXml.generatorFile();
        javaPageForm.generatorFile();
        javaSaveForm.generatorFile();
        javaService.generatorFile();
        javaVo.generatorFile();


        // vue
        vueApi.generatorFile();
        vueEdit.generatorFile();
        vueList.generatorFile();
    }

    // 生成service dao entity xml
    public void generatorServiceMapperBean(){
        JavaBean.generatorFile();
        javaMapper.generatorFile();
        javaMapperXml.generatorFile();
        javaService.generatorFile();
    }
}
